package com.lieve.bpm.config;

import com.lieve.bpm.entity.UserBean;
import org.activiti.engine.RepositoryService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author sunlijiang
 * @date 2020/5/1
 */
public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext
                = new AnnotationConfigApplicationContext(BpmConfig.class);
        annotationConfigApplicationContext.register(UserBean.class);
        /*
        annotationConfigApplicationContext.register(RepositoryService.class);
        annotationConfigApplicationContext.refresh();
        RepositoryService repositoryService = (RepositoryService) annotationConfigApplicationContext.getBean("repositoryService");

        String deploymentId = repositoryService
                .createDeployment()
                .addClasspathResource("processes/hello.bpmn20.xml")
                .deploy()
                .getId();
        System.out.println("deploymentId " + deploymentId);*/
        UserBean userBean = (UserBean) annotationConfigApplicationContext.getBean("userBean");
        userBean.hello();
    }
}
